package com.simple.framework.security.custom;

import com.simple.business.domain.vo.login.UserLoginSuccessVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutHandler;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Slf4j
@Component
public class CustomLogoutHandler implements LogoutHandler {
    @Override
    public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
        if (!(authentication instanceof LoginSuccessToken)) {
            return;
        }
        log.info("用户退出登录，登录信息:{}", authentication.toString());
        LoginSuccessToken token = (LoginSuccessToken) authentication;
        UserLoginSuccessVO vo = token.getLoginSuccessVO();
    }
}
